using UnityEngine;
using System.Collections;

public class planetLiveCheck : MonoBehaviour {

	public Color color;
	public int planet;
	public GameObject lord;
	public bool tut;
	public bool last;
	
	 public bool planetOn;
	
	public Texture complete;
	
	void Start () {
		lord = GameObject.FindWithTag("Lord");
	}
	void Update () {
		
		planetOn = lord.GetComponent<levelStorage>().levelsCompletedSolarSystemOne[planet];
		
		if(planetOn)
		{
			color = new Color(1,1,1,1);
		}
		else 
		{
			color = new Color(1,1,1,0);
		}
		transform.renderer.material.color = color;
	}
	void OnGUI()
	{
		if(last)
		{
			if(planetOn)
			{
				GUI.DrawTexture(new Rect((Screen.width/2), Screen.height*.8f,400,200), complete, ScaleMode.ScaleToFit, true, 0);
			}
		}
	}
}
